<?php
date_default_timezone_set('Asia/Shanghai');
header('Content-type: text/html; charset=utf-8');

define('DS', DIRECTORY_SEPARATOR);
define('CURR_TIME', time());
define('ROOT_PATH', __DIR__ . '/..');
define('APP_PATH', ROOT_PATH . '/application');
define('LOG_PATH',ROOT_PATH . '/runtime/log');
define('WEBSITE_PATH', __DIR__);

define('OPEN_DEBUG_MSG', true);

/**
 * 定向存储错误日志, 把错误日志存储到error.log文件里
 * 1-错误日志同时抛到前端
 * 0-错误日志不抛到前端, 返回500错误
 */
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); //设置错误日志等级
ini_set('display_errors',1);
ini_set('error_log', LOG_PATH . '/error.log'); //定向错误日志存储文件


require ROOT_PATH . '/vendor/autoload.php';

$environ = ini_get('yaf.environ');
$app  = new Yaf_Application(ROOT_PATH . "/conf/application.$environ.ini");
$app = $app->bootstrap();
$app->getDispatcher()->dispatch(new Yaf_Request_Simple());
